package Computer;

public class Point implements Comparable<Point>{
    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getAttack() {
        return attack;
    }

    public void setAttack(int attack) {
        this.attack = attack;
    }

    public int getDefence() {
        return defence;
    }

    public void setDefence(int defence) {
        this.defence = defence;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getSum() {
        return sum;
    }

    public void setSum(int sum) {
        this.sum = sum;
    }

    int x;
    int y;
    int attack;
    int defence;
    int sum;
    /**
     * 重写比较算法
     * <p>用于computer里给Point列表排序</p>
     * @param chessBean 一个Point变量
     */
    public int compareTo(Point chessBean) {

        if(this.sum>chessBean.sum) {
            return -1;
        }else if(this.sum<chessBean.sum) {
            return 1;
        }else
            return 0;
    }
}
